<template>
  <div class="user">

    <el-card class="box-card" style="width: 65%;">
      <img src="~assets/img/title.jpg" alt="">
      <div class="title-text" v-if="isShow" style="text-align: center">您今天还未打卡</div>
      <div class="title-text" v-if="!isShow" style="text-align: center">您已连续打卡{{dailyForm.fillingDays}}天</div>
      <el-form :model="dailyForm" :rules="dailyFormRules" ref="dailyFormRef" class="demo-ruleForm" style="margin-top: 20px">
        <el-form-item label="1、填报日期">
          <el-input v-model="dailyForm.fillTime" :disabled="true"></el-input>
        </el-form-item>
        <el-form-item label="2、姓名" prop="name">
          <el-input v-model="dailyForm.name" :disabled="true"></el-input>
        </el-form-item>
        <el-form-item label="3、证件类型" prop="certificateType">
          <el-select v-model="dailyForm.certificateType" placeholder="请选择">
            <el-option
                v-for="item in certificateTypeOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="4、证件号码" prop="idNumber">
          <el-input v-model="dailyForm.idNumber" clearable></el-input>
        </el-form-item>
        <el-form-item label="5、身份类别" >
          <el-input v-model="dailyForm.identityCategory" :disabled="true"></el-input>
        </el-form-item>
        <el-form-item label="6、所在校区" prop="schoolLocation">
          <el-select v-model="dailyForm.schoolLocation" placeholder="请选择">
            <el-option
                key="松山湖校区"
                label="松山湖校区"
                value="松山湖校区">
            </el-option>
            <el-option
                key="莞城校区"
                label="莞城校区"
                value="莞城校区">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="7、籍贯" prop="nativePlace">
          <el-input v-model="dailyForm.nativePlace" clearable></el-input>
        </el-form-item>
        <el-form-item label="8、户籍" prop="householdRegister">
          <el-input v-model="dailyForm.householdRegister" clearable></el-input>
        </el-form-item>
        <el-form-item label="9、家庭住址" prop="address">
          <el-input v-model="dailyForm.address" clearable></el-input>
        </el-form-item>
        <el-form-item label="10、电话号码" prop="phoneNumber">
          <el-input v-model="dailyForm.phoneNumber" clearable></el-input>
        </el-form-item>
        <el-form-item label="11、紧急联系人" prop="contacts">
          <el-input v-model="dailyForm.contacts" clearable></el-input>
        </el-form-item>
        <el-form-item label="12、紧急联系人联系方式" prop="contactNumber">
          <el-input v-model="dailyForm.contactNumber" clearable></el-input>
        </el-form-item>
        <el-form-item label="13、身体状况" prop="physicalCondition">
          <el-select v-model="dailyForm.physicalCondition" placeholder="请选择">
            <el-option
                v-for="item in physicalConditionOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="toEpidemicAreaLabel" prop="toEpidemicArea">
          <el-select v-model="dailyForm.toEpidemicArea" placeholder="请选择">
            <el-option
              v-for="item in tureOrFalse"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="14-1、曾途径以下疫区" prop="areaLocation" v-if="dailyForm.toEpidemicArea=='是'">
          <el-select v-model="dailyForm.areaLocation" placeholder="请选择">
            <el-option
              v-for="item in areaLocationOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="14-2、最后离开途径疫区的时间" prop="areaLeaveTime" v-if="dailyForm.toEpidemicArea=='是'">
          <el-date-picker
            v-model="dailyForm.areaLeaveTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item :label="contactPersonLabel" prop="contactPerson">
          <el-select v-model="dailyForm.contactPerson" placeholder="请选择">
            <el-option
              v-for="item in tureOrFalse"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="15-1、接触疫区人员的最后时间" prop="personLastTime" v-if="dailyForm.contactPerson=='是'">
          <el-date-picker
            v-model="dailyForm.personLastTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item :label="contactSuspectedCaseLabel" prop="contactSuspectedCase">
          <el-select v-model="dailyForm.contactSuspectedCase" placeholder="请选择">
            <el-option
              v-for="item in tureOrFalse"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="16-1、接触疑似/确证病例的最后时间" prop="caseLastTime" v-if="dailyForm.contactSuspectedCase=='是'">
        <el-date-picker
          v-model="dailyForm.caseLastTime"
          type="date"
          placeholder="选择日期">
        </el-date-picker>
        </el-form-item>
        <el-form-item label="17、是否在莞隔离医学观察" prop="isMedicalObservation">
          <el-select v-model="dailyForm.isMedicalObservation" placeholder="请选择">
            <el-option
              v-for="item in isMedicalObservationOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="17-1、预计终止医学隔离观察时间" prop="terminationObservationTime" v-if="dailyForm.isMedicalObservation!='否，没有隔离'&&dailyForm.isMedicalObservation!=''">
          <el-date-picker
            v-model="dailyForm.terminationObservationTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="18、目前是否在莞" prop="inGuan">
          <el-select v-model="dailyForm.inGuan" placeholder="请选择">
            <el-option
              v-for="item in inGuanOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="18-1、目前所在镇街" prop="guanTownStreet" v-if="dailyForm.inGuan=='是，在莞'">
          <el-select v-model="dailyForm.guanTownStreet" placeholder="请选择">
            <el-option
              v-for="item in guanTownStreetOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="18-1、目前所在地址（省/市/区）" prop="provinceCity" v-if="dailyForm.inGuan!='是，在莞'&&dailyForm.inGuan!=''">
          <el-input v-model="dailyForm.provinceCity" clearable></el-input>
        </el-form-item>
        <el-form-item label="18-2、计划返莞日期" prop="backGuanTime" v-if="dailyForm.inGuan=='否，已确定返莞时间'">
          <el-date-picker
            v-model="dailyForm.backGuanTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="18-3、返莞交通工具" prop="backGuanTransportation" v-if="dailyForm.inGuan=='否，已确定返莞时间'">
          <el-select v-model="dailyForm.backGuanTransportation" placeholder="请选择">
            <el-option
              v-for="item in backGuanTransportationOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="18-3-1、返莞计划乘坐交通工具的具体行程、时间" prop="backRouteTime" v-if="dailyForm.backGuanTransportation!='自驾'&&dailyForm.backGuanTransportation!=''&&dailyForm.inGuan=='否，已确定返莞时间'">
          <el-input v-model="dailyForm.backRouteTime" clearable></el-input>
        </el-form-item>
        <el-form-item :label="isLeaveGuanLabel" prop="isLeaveGuan">
          <el-select v-model="dailyForm.isLeaveGuan" placeholder="请选择">
            <el-option
              v-for="item in isLeaveGuanOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="19-1、具体出行时间和地点" prop="leaveTimePlace" v-if="dailyForm.isLeaveGuan.indexOf('是')!==-1">
          <el-input v-model="dailyForm.leaveTimePlace" clearable></el-input>
        </el-form-item>
        <el-form-item label="20、您是否为重点人群" prop="isMidpoint">
          <el-select v-model="dailyForm.isMidpoint" placeholder="请选择">
            <el-option
              v-for="item in isMidpointOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="familyConditionLabel" prop="familyCondition">
          <el-select v-model="dailyForm.familyCondition" placeholder="请选择">
            <el-option
              v-for="item in familyConditionOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="wentCityLabel" prop="wentCity">
          <el-select v-model="dailyForm.wentCity" placeholder="请选择">
            <el-option
              v-for="item in wentCityOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="23、备注" >
          <el-input v-model="dailyForm.remark" clearable></el-input>
        </el-form-item>
        <el-form-item label="24、今日体温（摄氏度，精确到小数点后一位，请按国家和学校规定如实填报，37.3以上为异常）"  prop="temperature">
          <el-input v-model="dailyForm.temperature" clearable></el-input>
        </el-form-item>
        <el-form-item v-if="isShow">
          <el-button type="primary" @click="submitForm" class="submit-button">提交</el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import {formatDate} from '@/common/utils'
import {chockIn, Form, getFillStatus, getLatestFormInfo, User} from '@/network/user'

let isMedicalObservation;
export default {
  name: "User",
  watch:{
    'dailyForm.toEpidemicArea':function (newValue,oldValue){
      if(newValue=='否'){
        this.dailyForm.areaLocation='';
        this.dailyForm.areaLeaveTime='';
      }
    },
    'dailyForm.contactPerson':function (newValue,oldValue){
      if(newValue=='否'){
        this.dailyForm.personLastTime='';
      }
    },
    'dailyForm.contactSuspectedCase':function (newValue,oldValue){
      if(newValue=='否'){
        this.dailyForm.caseLastTime='';
      }
    },
    'dailyForm.isMedicalObservation':function (newValue,oldValue){
      if(newValue=='否，没有隔离' || newValue==''){
        this.dailyForm.terminationObservationTime='';
      }
    },
    'dailyForm.inGuan':function(newValue,oldValue){
      if(newValue=="是，在莞"){
        this.dailyForm.provinceCity='';
        this.dailyForm.backGuanTime='';
        this.dailyForm.backGuanTransportation='';
        this.dailyForm.backRouteTime='';
      }
      if(newValue=='否，返莞时间未定'){
        this.dailyForm.guanTownStreet='';
        this.dailyForm.backGuanTime='';
        this.dailyForm.backGuanTransportation='';
        this.dailyForm.backRouteTime='';
      }
      if(newValue=="否，已确定返莞时间"){
        this.dailyForm.guanTownStreet='';
      }
      if(newValue==''){
        this.dailyForm.provinceCity='';
        this.dailyForm.backGuanTime='';
        this.dailyForm.backGuanTransportation='';
        this.dailyForm.backRouteTime='';
        this.dailyForm.guanTownStreet='';
      }
    },
    "dailyForm.backGuanTransportation":function (newValue,oldValue){
      if(newValue==''||newValue=='自驾'){
        this.dailyForm.backRouteTime='';
      }
    },
    "dailyForm.isLeaveGuan":function(newValue,oldValue){
      if(newValue.indexOf('否')!==-1){
        this.dailyForm.leaveTimePlace='';
      }
    }
  },
  data() {
    return {
      isShow:true,
      dailyForm: {
        fillingDays:1,  //打卡的天数
        fillTime: formatDate(new Date(),"yyyy-MM-dd"),
        name:'',
        certificateType:'',
        idNumber:'',
        identityCategory:'',
        schoolLocation:'',
        nativePlace:'',
        householdRegister:'',
        address:'',
        phoneNumber:'',
        contacts:'',
        contactNumber:'',
        physicalCondition:'',
        toEpidemicArea:'',
        areaLocation:'',
        areaLeaveTime:'',
        contactPerson:'',
        personLastTime:'',
        contactSuspectedCase:'',
        caseLastTime:'',
        isMedicalObservation:'',
        terminationObservationTime:'',
        inGuan:'',
        guanTownStreet:'',
        provinceCity:'',
        backGuanTime:'',
        backGuanTransportation:'',
        backRouteTime:'',
        isLeaveGuan:'',
        leaveTimePlace:'',
        isMidpoint:'',
        familyCondition:'',
        wentCity:'',
        remark:'',
        temperature:''
      },
      //表单验证规则
      dailyFormRules:{
        certificateType:[{required:true, message:'请输入必填项', trigger:'blur'}],
        idNumber:[{required:true, message:'请输入必填项', trigger:'blur'}],
        schoolLocation:[{required:true, message:'请输入必填项', trigger:'blur'}],
        nativePlace:[{required:true, message:'请输入必填项', trigger:'blur'}],
        householdRegister:[{required:true, message:'请输入必填项', trigger:'blur'}],
        address:[{required:true, message:'请输入必填项', trigger:'blur'}],
        phoneNumber:[{required: true, message:'请输入必填项', trigger:'blur'}, {validator:this.checkPhone, trigger: 'blur'}],
        contacts:[{required:true, message:'请输入必填项', trigger:'blur'}],
        contactNumber:[{required: true, message:'请输入必填项', trigger:'blur'}, {validator:this.checkPhone, trigger: 'blur'}],
        physicalCondition:[{required:true, message:'请输入必填项', trigger:'blur'}],
        toEpidemicArea:[{required:true, message:'请输入必填项', trigger:'blur'}],
        areaLeaveTime:[{required:true, message:'请输入必填项', trigger:'blur'}],
        areaLocation:[{required:true, message:'请输入必填项', trigger:'blur'}],
        contactPerson:[{required:true, message:'请输入必填项', trigger:'blur'}],
        personLastTime:[{required:true, message:'请输入必填项', trigger:'blur'}],
        contactSuspectedCase:[{required:true, message:'请输入必填项', trigger:'blur'}],
        caseLastTime:[{required:true, message:'请输入必填项', trigger:'blur'}],
        isMedicalObservation:[{required:true, message:'请输入必填项', trigger:'blur'}],
        terminationObservationTime:[{required:true, message:'请输入必填项', trigger:'blur'}],
        inGuan:[{required:true, message:'请输入必填项', trigger:'blur'}],
        guanTownStreet:[{required:true, message:'请输入必填项', trigger:'blur'}],
        provinceCity:[{required:true, message:'请输入必填项', trigger:'blur'}],
        backGuanTime:[{required:true, message:'请输入必填项', trigger:'blur'}],
        backGuanTransportation:[{required:true, message:'请输入必填项', trigger:'blur'}],
        backRouteTime:[{required:true, message:'请输入必填项', trigger:'blur'}],
        isLeaveGuan:[{required:true, message:'请输入必填项', trigger:'blur'}],
        leaveTimePlace:[{required:true, message:'请输入必填项', trigger:'blur'}],
        isMidpoint:[{required:true, message:'请输入必填项', trigger:'blur'}],
        familyCondition:[{required:true, message:'请输入必填项', trigger:'blur'}],
        wentCity:[{required:true, message:'请输入必填项', trigger:'blur'}],
        temperature:[{required:true, message:'请输入必填项', trigger:'blur'}]
      },
      certificateTypeOptions: [{value: '居民身份证', label: '居民身份证'}, {value: '军官证', label: '军官证'},
        {value: '士兵证', label: '士兵证'}, {value: '文职干部证', label: '文职干部证'}, {value: '部队离退休证', label: '部队离退休证'},
        {value: '香港特区护照/身份证', label: '香港特区护照/身份证'}, {value: '澳门特区护照/身份证', label: '澳门特区护照/身份证'},
        {value: '台湾居民来往大陆通行证', label: '台湾居民来往大陆通行证'}, {value: '境外永久居住证', label: '境外永久居住证'},
        {value: '护照', label: '护照'}, {value: '户口簿', label: '户口簿'}, {value: '其他', label: '其他'}],
      physicalConditionOptions:[{value: '良好', label: '良好'}, {value: '异常(发热，体温在37.3℃以上)', label: '异常(发热，体温在37.3℃以上)'},
        {value: '异常(咳嗽)', label: '异常(咳嗽)'}, {value: '异常(头晕)', label: '异常(头晕)'},
        {value: '异常(腹泻)', label: '异常(腹泻)'}, {value: '异常(乏力)', label: '异常(乏力)'},
        {value: '异常(同时含两种以上症状)', label: '异常(同时含两种以上症状)'}, ],
      tureOrFalse:[{value: '是', label: '是'},{value: '否', label: '否'}],
      isMedicalObservationOptions:[{value: '否，没有隔离', label: '否，没有隔离'}, {value: '否，在外地集中隔离或居家观察', label: '否，在外地集中隔离或居家观察'},
        {value: '是，居家隔离', label: '是，居家隔离'}, {value: '是，集中隔离', label: '是，集中隔离'}],
      inGuanOptions:[{value: '是，在莞', label: '是，在莞'}, {value: '否，已确定返莞时间', label: '否，已确定返莞时间'},
        {value: '否，返莞时间未定', label: '否，返莞时间未定'}],
      isLeaveGuanOptions:[{value: '否，留莞一直未出行', label: '否，留莞一直未出行'}, {value: '否，一直在外地，期间暂未回莞', label: '否，一直在外地，期间暂未回莞'},
        {value: '否，期间新增回莞，未出行', label: '否，期间新增回莞，未出行'}, {value: '是，期间偶尔离莞，此时已经回莞', label: '是，期间偶尔离莞，此时已经回莞'},
        {value: '是，期间偶尔离莞，此时未回莞', label: '是，期间偶尔离莞，此时未回莞'}],
      isMidpointOptions:[{value: '否', label: '否'}, {value: '是，有疑似症状', label: '是，有疑似症状'},
        {value: '是，最近14天途径疫情防控重点地区', label: '是，最近14天途径疫情防控重点地区'}, {value: '是，最近14天曾接触过“近14天出入过疫情重点防控地区的人员“', label: '是，最近14天曾接触过“近14天出入过疫情重点防控地区的人员“'},
        {value: '是，最近14天曾接触过疑似病例或确诊病例', label: '是，最近14天曾接触过疑似病例或确诊病例'}],
      familyConditionOptions:[{value: '以下均无', label: '以下均无'}, {value: '到达或途径疫情重点防控地区', label: '到达或途径疫情重点防控地区'},
        {value: '接触过近14天出入过疫情重点防控地区的人员', label: '接触过近14天出入过疫情重点防控地区的人员'}, {value: '接触过疑似/确证病例', label: '接触过疑似/确证病例'},
        {value: '疑似/确证病例', label: '疑似/确证病例'}],
      wentCityOptions:[{value: '否', label: '否'}, {value: '境外', label: '境外'},
        {value: '广东省广州市荔湾区', label: '广东省广州市荔湾区'}, {value: '广东省佛山市南海区', label: '广东省佛山市南海区'},
        {value: '广东省广州市番禺区', label: '广东省广州市番禺区'}, {value: '广东省广州市越秀区', label: '广东省广州市越秀区'},
        {value: '广东省广州市南沙区', label: '广东省广州市南沙区'}, {value: '广东省湛江市吴川市', label: '广东省湛江市吴川市'},
        {value: '广东省广州市白云区', label: '广东省广州市白云区'}, {value: '广东省深圳市宝安区', label: '广东省深圳市宝安区'},
        {value: '广东省东莞市南城街道', label: '广东省东莞市南城街道'}],
      areaLocationOptions:[],  //在created中使用数组解构
      guanTownStreetOptions:[ {value: '莞城', label: '莞城'}, {value: '石龙', label: '石龙'},
        {value: '虎门', label: '虎门'}, {value: '东城', label: '东城'},
        {value: '万江', label: '万江'}, {value: '南城', label: '南城'},
        {value: '中堂', label: '中堂'}, {value: '望牛墩', label: '望牛墩'},
        {value: '麻涌', label: '麻涌'}, {value: '石碣', label: '石碣'},
        {value: '高埗', label: '高埗'}, {value: '道滘', label: '道滘'},
        {value: '洪梅', label: '洪梅'}, {value: '沙田', label: '沙田'},
        {value: '厚街', label: '厚街'}, {value: '长安', label: '长安'},
        {value: '寮步', label: '寮步'}, {value: '大岭山', label: '大岭山'},
        {value: '大朗', label: '大朗'}, {value: '黄江', label: '黄江'},
        {value: '樟木头', label: '樟木头'}, {value: '清溪', label: '清溪'},
        {value: '塘厦', label: '塘厦'}, {value: '凤岗', label: '凤岗'},
        {value: '谢岗', label: '谢岗'}, {value: '常平', label: '常平'},
        {value: '桥头', label: '桥头'}, {value: '横沥', label: '横沥'},
        {value: '东坑', label: '东坑'}, {value: '企石', label: '企石'},
        {value: '石排', label: '石排'}, {value: '茶山', label: '茶山'}, {value: '松山湖', label: '松山湖'}],
      backGuanTransportationOptions:[ {value: '火车', label: '火车'}, {value: '飞机', label: '飞机'},
        {value: '轮船', label: '轮船'}, {value: '长途公共巴士', label: '长途公共巴士'},
        {value: '自驾', label: '自驾'}, {value: '其他', label: '其他'}],
      toEpidemicAreaLabel:"",
      contactPersonLabel: "",
      contactSuspectedCaseLabel: "",
      isLeaveGuanLabel:"",
      familyConditionLabel:"",
      wentCityLabel:""
    }
  },
  methods: {
    //验证手机号码
    checkPhone(rule,value,callback){
      let reg = /^[1][3,4,5,6,7,8][0-9]{9}$/
      if(value==''||value ==undefined || value==null){
        callback()
      }
      else{
        if(!reg.test(value)){
          callback(new Error('请输入正确的手机号码'))
        }else{
          callback();
        }
      }
    },
    //提交表单
    submitForm(){
      this.$refs.dailyFormRef.validate(valid=>{
        if(!valid){
          this.$message.error({message:"请按提示填写表单", duration:1000});
          return false;
        }
        let user = new User(this.dailyForm);
        let form = new Form(this.dailyForm);
        console.log(user);
        console.log(form);
;        chockIn({userInfo:user,dailyForm:form}).then(res=>{
          console.log(res);
          if(res.code==0){
            this.$message.error({message:res.msg,duration:1000});
            return false;
          }
          if(res.code==-1){
            this.$message.error({message:'填报失败，请重新提交',duration:1000});
            return false;
          }
          if(res.code==200){
            this.dailyForm.fillingDays = res.data.fillingDays;
            this.isShow = false;
          }
        })
      })
    },
    datePattern() {
      const now = formatDate(new Date(), "MM月dd日");
      const beforeDate = new Date(new Date().getTime() - 14 * 24 * 60 * 60 * 1000);
      const before = formatDate(beforeDate, "yyyy年MM月dd日");
      return before + "至" + now;
    }
  },
  created(){
    let [arg0,...arg] = this.wentCityOptions
    this.areaLocationOptions=arg;
    this.toEpidemicAreaLabel= "14、"+this.datePattern()+"是否到达或途径疫情防控重点地区";
    this.contactPersonLabel= "15、"+this.datePattern()+"是否接触过疫区人员";
    this.contactSuspectedCaseLabel ="16、"+this.datePattern()+"是否有接触过疑似/确诊病例";
    this.isLeaveGuanLabel = "19、"+this.datePattern()+"是否有离莞出行的行动";
    this.familyConditionLabel ="21、"+this.datePattern()+"同住的家庭成员情况是否有如下情况";
    this.wentCityLabel ="22、"+this.datePattern()+"内曾在以下城市";
    //获取最新的表单数据
    getLatestFormInfo().then(res=>{
      if(res.code===200) {
        console.log(res.data.dailyForm);
        if (res.data.dailyForm) {
          this.dailyForm = {...this.dailyForm,...res.data.userInfo, ...res.data.dailyForm}
          console.log(res.data.dailyForm.guanTownStreet);
          this.dailyForm.areaLocation=res.data.dailyForm.areaLocation;
          this.dailyForm.areaLeaveTime=res.data.dailyForm.areaLeaveTime;
          this.dailyForm.personLastTime=res.data.dailyForm.personLastTime;
          this.dailyForm.caseLastTime=res.data.dailyForm.caseLastTime;
          this.dailyForm.terminationObservationTime=res.data.dailyForm.terminationObservationTime;
          this.dailyForm.guanTownStreet=res.data.dailyForm.guanTownStreet;
          this.dailyForm.provinceCity=res.data.dailyForm.provinceCity;
          this.dailyForm.backGuanTime=res.data.dailyForm.backGuanTime;
          this.dailyForm.backGuanTransportation=res.data.dailyForm.backGuanTransportation;
          this.dailyForm.backRouteTime=res.data.dailyForm.backRouteTime;
          this.dailyForm.leaveTimePlace=res.data.dailyForm.leaveTimePlace;
        } else {
          this.dailyForm = {...this.dailyForm,...res.data.userInfo}
        }
      }
    });
    //获取今日是否已提交的状态
    getFillStatus().then(res=>{
      if(res.code==200){
        this.isShow=true;
      }
      else{
        this.isShow=false;
        if(res.data.fillingDays)
          this.dailyForm.fillingDays = res.data.fillingDays;
      }
    })

  }


}
</script>

<style scoped>
  .title-text{
    color: #ff0000;
  }
  .user{
    width: 100%;
    display: flex;
    justify-content: center;
    background-color: #eee;
  }
  img{
    width: 100%;
  }
  .submit-button{
    width: 200px;
    position: relative;
    left:50%;
    transform: translate(-50%);
  }

</style>
